<?php

/**
 * 
 * 
 */
class TController extends Controller
{
	public $appId = 1;
	
	public function __construct($id, $module = null) {
		parent::__construct($id, $module);
	}
	
	public function initData($name)
	{
		$tinit = new Tinit();
		return $tinit->$name();
	}

	/**
	 * 跳转
	 */
	public function showAlert($message){
		$this->layout='//layouts/alert';
		$this->render('//site/alert',array(
			'message'=>$message,
		));
		exit;
	}

	/**
	 * 是否有访问后台权限 
	 */
	public function isAdmin(){
		/*
		$adminManager = InitModel::getAdmin();
		$adminCon = array('admin','coins','spendType');
		if(in_array($this->id,$adminCon)){
			if(!in_array($this->userInfo['username'],$adminManager)){
				$res = array('url'=>$this->createUrl('site/index'),'msg'=>Yii::t('common','没有权限'),'code'=>2);
				$this->showMessage($res);
			}
		}
		*/
	}
	
}